package com.house365.app.analyse.data;

import java.util.UUID;

import com.house365.app.analyse.store.SharedPreferencesDTO;


/**
 * @author Rick Ping
 * @date Aug 7, 2012
 * @comment
 */
public class AnalyseMetaData extends SharedPreferencesDTO{
	private String uuid;
	private String app;
	private String version;
	private int platform;
	private String deviceid;
	private int event;
	private String eventobj;
	private String ip;
	private String location;
	private long optime;
	private String page;
	private String provider;
	private String screen;
	private String model;
	
	private long starttime;
	private long endtime;
	private String channel;
	private String network;
	
	private String city;//what a fucking parameter,it can not be in common!!!!
	private String os_version;
	
	//扩展字段
	private String data;
	public AnalyseMetaData() {
		super();
	}
	public AnalyseMetaData(String app, String version, int platform,
			String deviceid, int event, String eventobj, long optime, String page, String provider,
			String screen, String model, long starttime, long endtime,String channel,String network,String city,String os_version) {
		super();
		uuid = UUID.randomUUID().toString();
		this.app = app;
		this.version = version;
		this.platform = platform;
		this.deviceid = deviceid;
		this.event = event;
		this.eventobj = eventobj;
		this.optime = optime;
		this.page = page;
		this.provider = provider;
		this.screen = screen;
		this.model = model;
		this.starttime = starttime;
		this.endtime = endtime;
		this.channel = channel;
		this.network = network;
		this.city = city;
		this.os_version = os_version;
	}
	public AnalyseMetaData(String app, String version, int platform,
			String deviceid, int event, String eventobj, long optime, String page, String provider,
			String screen, String model, long starttime, long endtime,String channel,String network,String city,String os_version,String data) {
		super();
		uuid = UUID.randomUUID().toString();
		this.app = app;
		this.version = version;
		this.platform = platform;
		this.deviceid = deviceid;
		this.event = event;
		this.eventobj = eventobj;
		this.optime = optime;
		this.page = page;
		this.provider = provider;
		this.screen = screen;
		this.model = model;
		this.starttime = starttime;
		this.endtime = endtime;
		this.channel = channel;
		this.network = network;
		this.city = city;
		this.os_version = os_version;
		this.data = data;
	}
	public String getApp() {
		return app;
	}
	public void setApp(String app) {
		this.app = app;
	}
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public int getPlatform() {
		return platform;
	}
	public void setPlatform(int platform) {
		this.platform = platform;
	}
	public String getDeviceid() {
		return deviceid;
	}
	public void setDeviceid(String deviceid) {
		this.deviceid = deviceid;
	}
	public int getEvent() {
		return event;
	}
	public void setEvent(int event) {
		this.event = event;
	}
	public String getEventobj() {
		return eventobj;
	}
	public void setEventobj(String eventobj) {
		this.eventobj = eventobj;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public String getLocation() {
		return location;
	}
	public void setLocation(String location) {
		this.location = location;
	}
	public String getPage() {
		return page;
	}
	public void setPage(String page) {
		this.page = page;
	}
	public String getProvider() {
		return provider;
	}
	public void setProvider(String provider) {
		this.provider = provider;
	}
	public String getScreen() {
		return screen;
	}
	public void setScreen(String screen) {
		this.screen = screen;
	}
	public String getModel() {
		return model;
	}
	public void setModel(String model) {
		this.model = model;
	}
	public long getOptime() {
		return optime;
	}
	public void setOptime(long optime) {
		this.optime = optime;
	}
	public long getStarttime() {
		return starttime;
	}
	public void setStarttime(long starttime) {
		this.starttime = starttime;
	}
	public long getEndtime() {
		return endtime;
	}
	public void setEndtime(long endtime) {
		this.endtime = endtime;
	}
	@Override
	public boolean isSame(Object o) {
		return this.uuid.equals(((AnalyseMetaData)o).getUuid());
	}
	public String getUuid() {
		return uuid;
	}
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	public String getChannel() {
		return channel;
	}
	public void setChannel(String channel) {
		this.channel = channel;
	}
	public String getNetwork() {
		return network;
	}
	public void setNetwork(String network) {
		this.network = network;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getOs_version() {
		return os_version;
	}
	public void setOs_version(String os_version) {
		this.os_version = os_version;
	}
	public String getData() {
		return data;
	}
	public void setData(String data) {
		this.data = data;
	}
    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("\nAnalyseMetaData [");
        if (uuid != null) {
            builder.append("uuid=");
            builder.append(uuid);
            builder.append(", ");
        }
        if (app != null) {
            builder.append("app=");
            builder.append(app);
            builder.append(", ");
        }
        if (version != null) {
            builder.append("version=");
            builder.append(version);
            builder.append(", ");
        }
        builder.append("platform=");
        builder.append(platform);
        builder.append(", ");
        if (deviceid != null) {
            builder.append("deviceid=");
            builder.append(deviceid);
            builder.append(", ");
        }
        builder.append("event=");
        builder.append(event);
        builder.append(", ");
        if (eventobj != null) {
            builder.append("eventobj=");
            builder.append(eventobj);
            builder.append(", ");
        }
        if (ip != null) {
            builder.append("ip=");
            builder.append(ip);
            builder.append(", ");
        }
        if (location != null) {
            builder.append("location=");
            builder.append(location);
            builder.append(", ");
        }
        builder.append("optime=");
        builder.append(optime);
        builder.append(", ");
        if (page != null) {
            builder.append("page=");
            builder.append(page);
            builder.append(", ");
        }
        if (provider != null) {
            builder.append("provider=");
            builder.append(provider);
            builder.append(", ");
        }
        if (screen != null) {
            builder.append("screen=");
            builder.append(screen);
            builder.append(", ");
        }
        if (model != null) {
            builder.append("model=");
            builder.append(model);
            builder.append(", ");
        }
        builder.append("starttime=");
        builder.append(starttime);
        builder.append(", endtime=");
        builder.append(endtime);
        builder.append(", ");
        if (channel != null) {
            builder.append("channel=");
            builder.append(channel);
            builder.append(", ");
        }
        if (network != null) {
            builder.append("network=");
            builder.append(network);
            builder.append(", ");
        }
        if (city != null) {
            builder.append("city=");
            builder.append(city);
            builder.append(", ");
        }
        if (os_version != null) {
            builder.append("os_version=");
            builder.append(os_version);
            builder.append(", ");
        }
        if (data != null) {
            builder.append("data=");
            builder.append(data);
        }
        builder.append("]");
        return builder.toString();
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((app == null) ? 0 : app.hashCode());
        result = prime * result + ((channel == null) ? 0 : channel.hashCode());
        result = prime * result + ((city == null) ? 0 : city.hashCode());
        result = prime * result + ((data == null) ? 0 : data.hashCode());
        result = prime * result + ((deviceid == null) ? 0 : deviceid.hashCode());
        result = prime * result + (int) (endtime ^ (endtime >>> 32));
        result = prime * result + event;
        result = prime * result + ((eventobj == null) ? 0 : eventobj.hashCode());
        result = prime * result + ((ip == null) ? 0 : ip.hashCode());
        result = prime * result + ((location == null) ? 0 : location.hashCode());
        result = prime * result + ((model == null) ? 0 : model.hashCode());
        result = prime * result + ((network == null) ? 0 : network.hashCode());
        result = prime * result + (int) (optime ^ (optime >>> 32));
        result = prime * result + ((os_version == null) ? 0 : os_version.hashCode());
        result = prime * result + ((page == null) ? 0 : page.hashCode());
        result = prime * result + platform;
        result = prime * result + ((provider == null) ? 0 : provider.hashCode());
        result = prime * result + ((screen == null) ? 0 : screen.hashCode());
        result = prime * result + (int) (starttime ^ (starttime >>> 32));
        result = prime * result + ((uuid == null) ? 0 : uuid.hashCode());
        result = prime * result + ((version == null) ? 0 : version.hashCode());
        return result;
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        AnalyseMetaData other = (AnalyseMetaData) obj;
        if (app == null) {
            if (other.app != null) return false;
        } else if (!app.equals(other.app)) return false;
        if (channel == null) {
            if (other.channel != null) return false;
        } else if (!channel.equals(other.channel)) return false;
        if (city == null) {
            if (other.city != null) return false;
        } else if (!city.equals(other.city)) return false;
        if (data == null) {
            if (other.data != null) return false;
        } else if (!data.equals(other.data)) return false;
        if (deviceid == null) {
            if (other.deviceid != null) return false;
        } else if (!deviceid.equals(other.deviceid)) return false;
        if (endtime != other.endtime) return false;
        if (event != other.event) return false;
        if (eventobj == null) {
            if (other.eventobj != null) return false;
        } else if (!eventobj.equals(other.eventobj)) return false;
        if (ip == null) {
            if (other.ip != null) return false;
        } else if (!ip.equals(other.ip)) return false;
        if (location == null) {
            if (other.location != null) return false;
        } else if (!location.equals(other.location)) return false;
        if (model == null) {
            if (other.model != null) return false;
        } else if (!model.equals(other.model)) return false;
        if (network == null) {
            if (other.network != null) return false;
        } else if (!network.equals(other.network)) return false;
        if (optime != other.optime) return false;
        if (os_version == null) {
            if (other.os_version != null) return false;
        } else if (!os_version.equals(other.os_version)) return false;
        if (page == null) {
            if (other.page != null) return false;
        } else if (!page.equals(other.page)) return false;
        if (platform != other.platform) return false;
        if (provider == null) {
            if (other.provider != null) return false;
        } else if (!provider.equals(other.provider)) return false;
        if (screen == null) {
            if (other.screen != null) return false;
        } else if (!screen.equals(other.screen)) return false;
        if (starttime != other.starttime) return false;
        if (uuid == null) {
            if (other.uuid != null) return false;
        } else if (!uuid.equals(other.uuid)) return false;
        if (version == null) {
            if (other.version != null) return false;
        } else if (!version.equals(other.version)) return false;
        return true;
    }
	
    
}
